
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">

    <title>CTKHO</title>
    <link rel="stylesheet" type="text/css" href="{$baseUrl}/styles/dm.css">
	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/pkp.css" type="text/css" />
	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/common.css" type="text/css" />
	<link rel="stylesheet" href="{$baseUrl}/styles/common.css" type="text/css" />
    <link rel="stylesheet" type="text/css" class="init">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset={$defaultCharset|escape}" />
	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/pkp.css" type="text/css" />
	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/common.css" type="text/css" />
	<link rel="stylesheet" href="{$baseUrl}/styles/common.css" type="text/css" />
	<link rel="stylesheet" href="{$baseUrl}/styles/ctkho.css" type="text/css" />

	<!-- Base Jquery -->
	{*
	{if $allowCDN}<script type="text/javascript" src="http://www.google.com/jsapi"></script>
	<script type="text/javascript">{literal}
		// Provide a local fallback if the CDN cannot be reached
		if (typeof google == 'undefined') {
			document.write(unescape("%3Cscript src='{/literal}{$baseUrl}{literal}/lib/pkp/js/lib/jquery/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
			document.write(unescape("%3Cscript src='{/literal}{$baseUrl}{literal}/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js' type='text/javascript'%3E%3C/script%3E"));
		} else {
			google.load("jquery", "{/literal}{$smarty.const.CDN_JQUERY_VERSION}{literal}");
			google.load("jqueryui", "{/literal}{$smarty.const.CDN_JQUERY_UI_VERSION}{literal}");
		}
	{/literal}</script>
	{else}
	*}
	<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/lib/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js"></script>
	{*{/if}
	*}

	<script type="text/javascript" src="{$baseUrl}/classes/acct/js/CNCTKHO.js"></script>
	<script type="text/javascript" src="{$baseUrl}/classes/acct/js/danhmucRF.js"></script>


</head>
    <script type="text/javascript" src="{$baseUrl}/classes/acct/js/CNKHOList.js"></script>
 </head>

<div id = "ttNam" style="display:none">{$xNam}</div>
<body class="dt-example">

{include file="acct/acctNavbar.tpl"}

<div class="DMtitle" style = "valign: left; text-align: left; text-transform: uppercase "><strong>{$loaiphieu} --- N. {$xNam}</strong></div>



<form method="post" action="{$url}">
<table width = "70%" align = "left" >
<tr rowspan = "2">
<td width = "80%" align = "center" >
<hr size="2" noshade style="color:#000000"  />
T&#7915; ngày: 
{html_select_date prefix="dateExpire1" all_extra="class=\"selectMenu\""  day_extra= 1 start_year="-5" end_year="+5" time="$Date1"}
&#272;&#7871;n ngày: 
{html_select_date prefix="dateExpire2" all_extra="class=\"selectMenu\""  day_extra= 1 start_year="-5" end_year="+5" time="$Date2"}
</td>

</tr>
<tr height = "12px">
</tr>
<tr rowspan = "2">
<td width = "80%" align = "center" >
	<select name="searchField" size="1" class="selectMenu">
		{html_options options=$fieldOptions selected=$searchField}
	</select>

	<select name="searchMatch" size="1" class="selectMenu">
		<option value="contains"{if $searchMatch == 'contains'} selected="selected"{/if}>C&#243; ch&#7913;a</option>
		<option value="is"{if $searchMatch == 'is'} selected="selected"{/if}>L&#224;</option>
		<option value="startsWith"{if $searchMatch == 'startsWith'} selected="selected"{/if}>B&#7855;t &#273;&#7847;u l&#224; </option>
	</select>

	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;
	<input type="submit" value="Tìm - Xem " class="button" />
	<input id="cancel" type="button" onclick="Ret('{$urlRet}');" value="Trở về " class="button" />

	<hr size="2" noshade style="color:#000000"  />
		
</td>


</tr>


<tr>

</tr>
</table>
{assign var="socot" value="9"}
{assign var="socot1" value="8"}

<br>
<table width = "80%" align = "left">
 {if $ctkts->wasEmpty()}
<tr>
	<td colspan="{$socot1}" class="nodata">Không có dữ liệu</td>
	<td> Thêm chứng từ mới</td>
</tr>
<tr>
	<td colspan="{$socot}" class="endseparator">&nbsp;</td>
</tr>

{else}
<tr>
	<td colspan="{$socot1}" align="left">{page_info iterator=$ctkts}
	&nbsp  &nbsp &nbsp &nbsp
	{page_links anchor="ctkts" name="ctkts" iterator=$ctkts searchField=$searchField searchMatch=$searchMatch search=$search ngay1 = $Date1 ngay2 = $Date2 ChiTiet=$mact}</td>
	<td>
	<input type="button" value="Thêm chứng từ mới" class="button" onclick="document.location.href='{url page= "acctCN" op='CTBANHANG' ChiTiet=$mact Mode = 'add' Nam=$xNam escape=false}'" /> 
	</td>

</tr>

{/if}
</table>


</form>           
        <table id="customers"  cellspacing="0" width="100%">

            <thead>
            <tr>
                <th  > NGÀY </th>
                <th  > SỐ CT </th>
                <th  > KHO XUẤT </th>
                <th  > KHÁCH HÀNG </th>
		<th  > VẬT TƯ</th>
                <th  > SỐ LƯỢNG </th>
		<th  > ĐƠN GIÁ BÁN </th>
		<th  > SỐ TIỀN</th>
		<th  > Tác vụ </th>
            </tr>
            </thead>

            <tfoot>
            <tr>

            </tr>
            </tfoot>

            <tbody>
    	   
	    {assign var = "tpl_idphieu1" value = "0"}
	    {iterate from=ctkts item=ctkt name=ctkts}
		{assign var = "tpl_idphieu2" value = $ctkt->getidphieu()}

                <tr>
		{if $tpl_idphieu1 != $tpl_idphieu2}
                    <td >
			{$ctkt->getngct()|date_format:"%d/%m/%Y"|escape}
                    </td>
                    <td>
                            {$ctkt->getsoct()|escape}
                    </td>
                     <td id="noidung">
                        {$ctkt->getmakhox()|escape}
                    </td>
                    <td>
                        {$ctkt->getmadvno()|escape}
                    </td>
		    {else}
			<td colspan = 4></td>
		    {/if}
                    <td>
                        {$ctkt->getmavt()|escape}
                    </td>
                    <td id="sotien">
                        {$ctkt->getsl()|number_format:0:".":"."}
                    </td>

                    <td id="sotien">
                        {$ctkt->getdgb()|number_format:0:".":"."}
                    </td>

                    <td id="sotien">
                            {$ctkt->getsotienvnb()|number_format:0:".":"."}
                    </td> 
			
		     <td >
			{if $tpl_idphieu1 != $tpl_idphieu2}
			{assign var = "tpl_idphieu1" value = $tpl_idphieu2}
			<a  id = '{$ctkt->getidphieu()}' class="actiondelrow" href="javascript:void(0);" onclick="editCT('{$ctkt->getidphieu()}', '{$urlEdit}');">S&#7917;a </a>  &nbsp &nbsp
			<a  id = '{$ctkt->getidphieu()}' class="actiondelrow" href="javascript:void(0);" onclick="deleCT('{$journalid}','{$xNam}', '{$ctkt->getsoct()}', '{$ctkt->getidphieu()}', '{$urlDel}', '{$url}');">X&#243;a </a>  
			{/if}
		    </td>	
		 </tr>
            {/iterate}

	  </tbody>
        </table>
        <br>
</body>
</html>